package service

/*
import (
	"gitee.com/gopher2011/gva/server/dao"
	"gitee.com/gopher2011/gva/server/global"
	"time"
)

// 全局公开对象
var JwtBlackList = jwtBlackListService{}

// 私有对象，所有的方法都绑定到这个结构体上。
type jwtBlackListService struct{}

// 拉黑jwt
func (p *jwtBlackListService) JsonInBlacklist(arg dao.JwtBlackList) (int64, error) {
	return dao.JwtBlackListDao.InsertTemplate(arg)
}

func (p *jwtBlackListService) Delete() (int64, error) {
	return 0, nil
}

func (p *jwtBlackListService) Update(arg dao.JwtBlackList) (int64, error) {
	return 0, nil
}

func (p *jwtBlackListService) Select(id int64) (dao.JwtBlackList, error) {
	return dao.JwtBlackListDao.SelectTemplate(id)
}

func (p *jwtBlackListService) GetRedisJwt(username string) (redisJwt string, err error) {
	redisJwt, err = global.Redis.Get(username).Result()
	return
}

func (p *jwtBlackListService) SetRedisJwt(jwt, username string) (err error) {
	// 此处过期时间等于jwt过期时间
	timer := time.Duration(global.Config.JWT.ExpiresTime) * time.Second
	err = global.Redis.Set(username, jwt, timer).Err()
	return err
}*/
